package com.luyue.zagj.activity.base;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.Toast;

import com.luyue.zagj.BaseActivity;
import com.luyue.zagj.R;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class ResetPswActivity extends BaseActivity {

    @Bind(R.id.findPswPhone_cancel_btn)
    Button findPswPhoneCancelBtn;
    @Bind(R.id.reset_psw_top_rl)
    RelativeLayout resetPswTopRl;
    @Bind(R.id.reset_psw_new_ed)
    EditText resetPswNewEd;
    @Bind(R.id.reset_psw_sure_ed)
    EditText resetPswSureEd;
    @Bind(R.id.reset_psw_btn)
    Button resetPswBtn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_reset_psw);
        ButterKnife.bind(this);
    }

    @OnClick({R.id.findPswPhone_cancel_btn, R.id.reset_psw_btn})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.findPswPhone_cancel_btn:
                onBackPressed();
                break;
            case R.id.reset_psw_btn:
                CheckPsw();
                Toast.makeText(this,"成功修改新密码，已自动跳转",Toast.LENGTH_SHORT).show();
                Intent it = new Intent(this, LoginActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(it);
                break;
        }
    }

    private void CheckPsw() {
        //密码相同
    }
}
